import { createRouter, createWebHistory } from 'vue-router'
const Home=()=>import('../views/home/Home.vue') ;
const AccountAssess=()=>import('../views/accountAssess/AccountAssess.vue') ;
const AccountLocal=()=>import('../views/accountLoacl/AccountLocal.vue') ;
const AccountSearch=()=>import('../views/accountSearch/AccountSearch.vue') ;
const User=()=>import('../views/user/User.vue')
const Login=()=>import('../views/user/login/Login.vue') ;
const WbStorey=()=>import('../views/wbStorey/WbStorey.vue');

const routes = [
  {
    path:"",
    meta:{
      keepAlive: true
    },
    redirect: "/home"
  },
  {
    path:'/home',
    name:'Home',
    id:1,
    meta:{
      keepAlive: true
    },
    component:Home
  },
  {
    path:'/accountAssess',
    name:'AccountAssess',
    id:2,
    meta:{
      keepAlive: true
    },
    component:AccountAssess
  },  
  {
    path:'/accountLocal',
    name:'AccountLocal',
    id:3,
    meta:{
      keepAlive: true
    },
    component:AccountLocal
  },
  {
    path:'/accountSearch',
    name:'AccountSearch',
    id:4,
    meta:{
      keepAlive: true
    },
    component:AccountSearch
  },
  {
    path:'/user',
    name:'user',
    // redirect: "home/user/login",
    id:5,
    meta:{
      keepAlive: true
    },
    children:[
      {
        path:'',
        redirect:'/user/login',
        meta:{
          keepAlive:false
        }
      },
      {
        path:'login',
        id:51,
        meta:{
          keepAlive:false
        },
        component:Login
      },
      {
        path:'register',
        id:52,
        meta:{
          keepAlive:false
        },
        component:Login
      }
    ],
    component:User
  },
  {
    path:'/WbStorey',
    name:'WbStorey',
    id:7,
    meta:{
      keepAlive: true
    },
    component:WbStorey
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
